<template>
	<div class="dowload">
		<!-- {{data}} -->
		<img src="../images/Clock_02.png" />
		<div class="dowloaderwei">
			<img src="../images/Clock_05.png" />
		</div>
		
		<p>Clock APP v1.0</p>
		<div class="dowloadios">
			<a :href="ua_url"><img v-if="istrue==1" src="../images/Clock_09.png" /></a>
			<a :href="ua_url"><img v-if="istrue==2" src="../images/Clock_13.png" /></a>
		</div>
		<img src="../images/Clock_15.png" />
	</div>
</template>

<script>
	export default {
		name: "index",
		data() {
			return {
				title: '',
				updatedAt: '',
				content: '',
				type: '',
				source: '',
				publishingRule: '',
				numbers: '',
				author: '',
				istrue:'1',
				ua_url:'',
				data:''

			};
		},
		created() {},
		// 钩子函数异步请求接口时调取在钩子函数mouted中执行
		mounted() {
			var u = navigator.userAgent;
			var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
			var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端          
			if(isAndroid){
				this.init('android')		
				this.istrue='1'	
			}else if(isiOS){
				this.istrue='2'
				this.init('ios')
			}else{				
				this.ua_url='#/download'				
			}
			this.data=this.$t("message.global.view")
		},
		methods: {
		     /*初始化数据*/
			init(us) {						
				this.$get('/member/version/newest', {
						"platform": us
					})
					.then((res) => {						
						this.ua_url=res.download_url						
					})
					.catch((res) => {
						this.ua_url='#/download'
					})
			}
			
		}
	};
</script>

<style>
	body {
		margin: 0px;
	}
</style>
<style type="text/css" lang="scss" scoped="scoped">
	.dowload img {
		width: 100%;
	}
	
	.dowload p {
		text-align: center;
		margin-top: 0px;
		font-size: 0.9375rem;
	}
	
	.dowloaderwei {
		width: 377px;
		height: 374px;
		text-align: center;
		margin: 100px auto 0rem auto;
	}
	
	.dowloadios {
		text-align: center;
		width: 540px;
		height: 90px;
		margin:2.125rem auto 1.125rem auto;
	}
	
	.dowloadios a {
		height: 90px;
		display: inline-block;
	}
	
	/*.dowloadios img:nth-of-type(1) {
		margin-bottom: 30px;
		margin-top: 80px;
	}*/
	
	.dowloaderwei img {
		
	}
</style>